1. Field of the Invention
The present invention relates to a clipping device for judging whether or not vertices expressed by a predetermined coordinate system and a polyhedron connecting the same are inside or outside a multi-dimensional region of an object to be drawn in computer graphics.
2. Description of the Related Art
In three-dimensional computer graphics, a three-dimensional world coordinate system is assumed. Processing such as modeling conversion or field of vision conversion is carried out on an object existing there, then viewport conversion for displaying that in a two-dimensional device is performed.
At this time, clipping judgment for judging whether or not an object projected in the two-dimensions is in a projection plane becomes necessary. More specifically, the object is expressed by a group of polyhedrons as a polygon, so it is necessary to judge whether vertex coordinates of the polyhedrons are inside or outside a predetermined region.
In this inside/outside judgment, if the coordinates are expressed as homogeneous coordinates, it is judged if a certain point exists in a certain cube if the following equations are satisfied. That is, for a point P (x, y, z), if the point is in the cube shown in for example FIG. 1. The conditions of the point P existing in the region are as follows:
−W≦x≦W
−W≦y≦W
−W≦z≦W
In order to judge if a vertex is outside of a region under these conditions, it is necessary to perform the following total six comparison operations for one vertex with respect to the X, Y, and Z axes.
X>W
X←W
Y>W
Y←W
Z>W
Z←W
If the coordinate X is larger than a judgment reference value W, if the coordinate X is smaller than −W, if the coordinate Y is larger than W, if the coordinate Y is smaller than −W, if the coordinate Z is larger than W, and if the coordinate Z is smaller than −W. It is judged as 1 when the results of the comparison satisfy the comparison conditions and judged as 0 when they do not satisfy the latter.
Namely, in the clipping device, for example when the coordinate X and the judgment reference value W are input, comparisons of whether the coordinate X is larger than the judgment reference value W and if the coordinate X is smaller than −W are carried out. It is judged as, or determined to be 1 when true, while it is judged as, or determined to be 0 when false. Due to this, the clipping device can determine whether a vertex is outside of the region in the case of 1.
In the clipping device mentioned above, however, in order to determine if a vertex is outside of the region, a total of six comparison operations must be carried out for one vertex with respect to the X, Y, and Z axes, so the number of processing cycles increases.
As a result, in the conventional clipping device, there are the disadvantages that a further increase of speed of the processing is difficult and a dedicated clipping operation circuit is complicated.